package com.org.cloud.lg.config;

import org.springframework.cloud.gateway.filter.ratelimit.KeyResolver;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import reactor.core.publisher.Mono;

/**
 * @ClassName: KeyResolverConfig
 * @Author: LG 限流策略配置
 * @Date: 2019/5/22 11:13
 * @Version: 1.0
 **/
@Configuration
public class KeyResolverConfig {

    @Bean
    KeyResolver apiKeyResolver() {
        return exchange -> Mono.just(exchange.getRequest().getPath().value());
    }
}
